-
Notifications
You must be signed in to change notification settings - Fork 204
Replace cp with cpfs/cpreq for atomic copies to COM directories #4130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace cp with cpfs/cpreq for atomic copies to COM directories #4130
Conversation
Co-authored-by: DavidHuber-NOAA <[email protected]>
JessicaMeixner-NOAA
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change in ush/wave_prnc_ice.sh is fine.
aerorahul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks ok.
@copilot Are these the only place where cp is being used now?
aerorahul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copying dev/null is the same as touching the file
Co-authored-by: Rahul Mahajan <[email protected]>
…ed-45fd-4baa-9f7e-6bcebdc16050
EdwardSafford-NOAA
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to the 3 minmon scripts look good to me.
|
Launching CI on WCOSS2. |
|
All tests passed on WCOSS2. Awaiting approval from @aerorahul before merging. |
aerorahul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions, some questions.
ush/minmon_xtrct_costs.pl
Outdated
| if( -e $filename2 ) { | ||
| my $newfile2 = "${tankdir}/${filename2}"; | ||
| system("cp -f $filename2 $newfile2"); | ||
| system("cpreq -f $filename2 $newfile2"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why cpreq and not cpfs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, does cpreq take -f?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably don't need it regardless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
ush/minmon_xtrct_reduct.pl
Outdated
| if( -e $outfile ) { | ||
| my $newfile = "${tankdir}/${outfile}"; | ||
| system("cp -f $outfile $newfile"); | ||
| system("cpfs -f $outfile $newfile"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| system("cpfs -f $outfile $newfile"); | |
| system("cpfs $outfile $newfile"); |
Does cpfs take -f?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it does not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
ush/minmon_xtrct_gnorms.pl
Outdated
|
|
||
| if( -e $filename2 ) { | ||
| system("cp -f $filename2 ${tankdir}/."); | ||
| system("cpfs -f $filename2 ${tankdir}/."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here and a few other places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All fixed.
|
I note in the logs the following error messages from the So any errors from the minimization package are not being handled correctly. I'll open up a follow-up issue for this. |
|
Rerunning all 4 |
|
Opened #4171 as a follow-up issue to harden the minimization scripts. |
aerorahul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
…NOAA-EPIC/global-workflow-cloud into feature/use_container_spack-stack-1.9.2 * 'feature/use_container_spack-stack-1.9.2' of github.com:NOAA-EPIC/global-workflow-cloud: reverse few changes re-sync with EMC repo Add master grib files to GFS HPSS archive for AIGFS (NOAA-EMC#4203) Update Snow filenames to comply with EE2 (NOAA-EMC#4195) Rename files for JEDI atm EE2 (NOAA-EMC#4193) Generate `pres_b` files for `RUN=gdas` and update `APCP` to `598`. (NOAA-EMC#4196) Update checks for MOM6 restarts when performing a re-run on failure (NOAA-EMC#4179) Decrease HPSS storage for GFS retros and address hpss bugs (NOAA-EMC#4184) Add noaacloud to ufsda case in dev/ush/load_modules (NOAA-EMC#4198) Remove replay from global workflow (NOAA-EMC#4182) Add IODA stats text file to COM (NOAA-EMC#4176) Update UFS_UTILS submodule (NOAA-EMC#4178) Atm COM File Rename to Standardized Form (NOAA-EMC#4117) Replace cp with cpfs/cpreq for atomic copies to COM directories (NOAA-EMC#4130) Create a UPP module for the global workflow (NOAA-EMC#4174) Refactor marine DA tasks (NOAA-EMC#4160) Delay ocean post-processing trigger to next-next forecast (NOAA-EMC#4167) Make options hashes Remove multiple option from static data template Fix static_data yaml (descriptions and labels) Fix static_data yaml (remove colon) Add Ursa to and remove C5 from list of HPCs in the bug report template (NOAA-EMC#4164) Rename marine (ocean/ice) files following EE2 conventions (NOAA-EMC#4162) Add attributes to Gaussian grid sfcanl file (NOAA-EMC#4149) Remove the snow analysis from archive (NOAA-EMC#4157) Update verif-global to fix pcp failures on special cases (NOAA-EMC#4154) Add CRTM fix directory paths to global-workflow (NOAA-EMC#4143) Update UFS Model (NOAA-EMC#4138) Add functionality to assimilate the new snow observations (NOAA-EMC#4132)
Description
This PR addresses issue #3051 by replacing standard
cpcommands with atomic copy utilities (cpfsandcpreqfromprod_util) for all copies to COM directories. This is required per NCO Implementation Standards v11 to prevent downstream programs from accessing incomplete files.Problem
Using standard
cpfor large files can result in downstream programs accessing incomplete copies while the copy operation is still in progress. This is particularly problematic in operational weather forecasting where timing and data integrity are critical.Solution
Replaced all instances of
cpto COM directories with:cpfs: For output files being copied TO COM directories (11 instances)cpreq: For required input files being copied FROM COM directories (1 instance)The
cpfsutility provides atomic copies by:This ensures downstream processes never see partially written files.
Changes
Modified 3 files with 12 total changes:
ush/tropcy_relocate.sh (5 changes)
ush/syndat_qctropcy.sh (6 changes)
ush/wave_prnc_ice.sh (1 change)
Testing
cpto COM directoriesImpact
Fixes #3051
Co-authored-by: @DavidHuber-NOAA
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.